package com.gsafety.wellsfort.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class SchoolTreeVO {

    @ApiModelProperty(value = "学校id")
    private Integer id;
    /**
     * 学校名称
     */
    @ApiModelProperty(value = "学校名称")
    private String name;

    @ApiModelProperty(value = "是否选中")
    private boolean selected;

    private List<ClassTreeVO> children;


    public SchoolTreeVO(Integer id, String name, boolean selected) {
        this.id = id;
        this.name = name;
        this.selected = selected;
    }

    public void addChildren(ClassTreeVO classTreeVO) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(classTreeVO);
    }
}
